//
//  Film.m
//  Film
//
//  Created by dllo on 16/3/5.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "Film.h"

@implementation Film
#pragma mark - 重写dealloc方法
- (void)dealloc {
    [_dictionary release];
    NSLog(@"Game Over");
    [super dealloc];
}

#pragma mark - Creating and init
- (instancetype)initWithDictionary:(NSMutableDictionary *)dictionary{
    self = [super init];
    if (self) {
        _dictionary = [dictionary retain];
    }
    return self;
}

+ (instancetype)filmWithWithDictionary:(NSMutableDictionary *)dictionary {
    return [[[Film alloc]initWithDictionary:dictionary] autorelease];
}

#pragma mark - 重写description
- (NSString *)description {
    return [NSString stringWithFormat:@"Title: %@, PicUrl: %@, Summary: %@", [self.dictionary objectForKey:@"title"],[self.dictionary objectForKey:@"picUrl"],[self.dictionary objectForKey:@"summary"]];
}
@end
